extends "../jifu-3/jifu-3.gd"


var baseId = ""
var upText1 = "八月风暴额外释放4道霜风"
var upText2 = "霜刃伤害提高30%"
func _extInit():
	._extInit()
	lv = 4             #等级的设置
	addSkill("每{cd}秒，随机向敌人放出12道霜风，对接触到的敌人造成[雷击*0.1]的伤害，并附带霜刃效果", "八月风暴", "jifu4", 15)

var p4 = 12
func upgrade():
	.upgrade()
	if upgraded == 1:
		p4 = 16
	if upgraded == 2:
		p3 = 1.3
		
func _castCdSkill(id):
	._castCdSkill(id)
	if id=="jifu4":
		jifu4()

func jifu4():
	for i in range(p4):
		var cha = utils.getRndEnemy(self)
		var eff:Eff = newEff("sk_feiZhan", sprcPos)
		eff._initFlyPos(position + (cha.position - position).normalized() * 1200, 800)
		eff.connect("onInCell",self,"effInCell")
		yield(reTimer(0.15),"timeout")

func effInCell(cell):
	var cha = matCha(cell)
	if cha == null:
		cha = matCha(cell + Vector2(0, 1))
	if cha != null and cha.team != team:
		azurHurtChara(cha, att.mgiAtk*0.1, sys.HurtType.WEAPON, sys.AtkType.SKILL, "八月风暴")
		frostBlade(cha)